package org.internet.tcp;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerDemo {
    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(10000);

        Socket socket = ss.accept();
        InputStream input = socket.getInputStream();
        int data;
        while ((data = input.read()) != -1) {
            System.out.print((char) data);
        }
        System.out.println();
        socket.close();
        ss.close();
    }
}
